package com.serv;


import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class ServActivity extends Activity implements OnClickListener {
	
	private static final String TAG = "MyService";
	MediaPlayer player;
	Button btn1,btn2;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        btn1 = (Button) findViewById(R.id.start);
        btn2 = (Button) findViewById(R.id.stop);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        
	}
    
    public void onClick(View src){
    	switch(src.getId()){
    	case R.id.start:
    	Log.d(TAG, "onClick: starting service" );
    	startService(new Intent(this, MyService.class));
    	break;
    	case R.id.stop:
    	Log.d(TAG, "onClick: stoping service" );
    	stopService(new Intent(this, MyService.class));
    	break;
    	}
    }
    
    }